﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public partial class HairGen
{
    public string findName { get { return "Hairs"; } }
    bool Exist(int i)
    {
        var name = "Hair " + i.ToString();
        var mode = System.StringComparison.OrdinalIgnoreCase;
        foreach (var hair in hairs)
        {
            if (string.Equals(name, hair.name, mode) ||
                string.Equals(name + ".l", hair.name, mode) ||
                string.Equals(name + ".r", hair.name, mode))
                return true;
        }
        return false;
    }
    public string newHairName
    {
        get
        {
            var i = 0;
            while (Exist(i)) i++;
            return "Hair " + i.ToString();
        }
    }
    public Hair hairCurr
    {
        get { return Selector.current == null ? null : Selector.current.GetComponent<Hair>(); }
        set { Selector.current = value.transform; }
    }
    Camera cam { get { return Camera.main; } }
}
